package com.example.yyjc.service.impl;

import com.example.yyjc.domain.countryanalyze.*;
import com.example.yyjc.mapper.CountryMapper;
import com.example.yyjc.service.CountryService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName CountryServiceImpl
 * @Description TODO
 * @Author lvyongwei
 * @Date 2020-11-11 14:33
 **/
@Service
public class CountryServiceImpl implements CountryService {

    @Autowired
    private CountryMapper countryMapper;

    /**
     * 获取所有国家,按订单数量排序
     * @param time
     * @return
     */
    @Override
    public List<String> getAllCountry(String time) {
        return countryMapper.getAllCountry(time);
    }

    /**
     * 获取所有时间
     * @return
     */
    @Override
    public List<String> getAllTime() {
        return countryMapper.getAllTime();
    }

    /**
     * 获取所有时间 升序
     * @return
     */
    @Override
    public List<String> getAllTimeAsc(String beginTime,String endTime) {
        return countryMapper.getAllTimeAsc(beginTime,endTime);
    }

    /**
     * 获取所有日期 升序
     *
     * @return
     */
    @Override
    public List<String> getAllTimeAsc2() {
        return countryMapper.getAllTimeAsc2();
    }

    /**
     * 获取所有国家订单个数
     * @param time
     * @return
     */
    @Override
    public List<Country> getCountryOrderCount(String time) {
        return countryMapper.getCountryOrderCount(time);
    }

    /**
     * 获取前十国家名称
     * @return
     */
    @Override
    public List<String> getCountryName(String time) {
        return countryMapper.getCountryName(time);
    }

    /**
     *
     * 获取时间内所有的信息
     * @param countryName
     * @param times
     * @return
     */
    @Override
    public List<Double> getCountryOrderCountByTime(String countryName, List<String> times) {
        return countryMapper.getCountryOrderCountByTime(countryName,times);
    }


    /**
     * 获取商品订单区间
     * @return
     */
    @Override
    public List<String> getOrderAnalysis(String countryName) {
        return countryMapper.getOrderAnalysis(countryName);
    }

    /**
     * 获取各个月份国家订单区间商品数量
     * @param times
     * @param orderCountLimit
     * @param countryName
     * @return
     */
    @Override
    public List<Double> getOrderGoodsCount(List<String> times, String orderCountLimit, String countryName) {
        return countryMapper.getOrderGoodsCount(times,orderCountLimit,countryName);
    }

    /**
     * 获取各个月份国家订单区间商品数量比例
     * @param times
     * @param orderCountLimit
     * @param countryName
     * @return
     */
    @Override
    public List<Double> getOrderGoodsCountScale(List<String> times, String orderCountLimit, String countryName) {
        return countryMapper.getOrderGoodsCountScale(times, orderCountLimit, countryName);
    }

    /**
     * 获取商品价格区间
     * @param countryName 国家名称
     * @return
     */
    @Override
    public List<String> getPriceAnalysis(String countryName) {
        return countryMapper.getPriceAnalysis(countryName);
    }

    /**
     * 获取各个月份国家价格区间商品数量
     * @param times
     * @param priceCountLimit
     * @param countryName
     * @return
     */
    @Override
    public List<Double> getPriceGoodsCount(List<String> times, String priceCountLimit, String countryName) {
        return countryMapper.getPriceGoodsCount(times,priceCountLimit,countryName);
    }


    /**
     * 获取各个月份国家价格区间商品数量占比
     * @param times
     * @param orderCountLimit
     * @param countryName
     * @return
     */
    @Override
    public List<Double> getPriceGoodsCountScale(List<String> times, String orderCountLimit, String countryName) {
        return countryMapper.getPriceGoodsCountScale(times,orderCountLimit,countryName);
    }

    /**
     * 获取各个月份国家价格区间订单数量
     * @param times
     * @param priceCountLimit
     * @param countryName
     * @return
     */
    @Override
    public List<Double> getPriceOrderCount(List<String> times, String priceCountLimit, String countryName) {
        return countryMapper.getPriceOrderCount(times,priceCountLimit,countryName);
    }

    /**
     * 获取某个国家月份的一级类目比例
     * @param countryName
     * @param time
     * @return
     */
    @Override
    public List<MainTitleScale> getMainTitle(String countryName, String time) {
        return countryMapper.getMainTitle(countryName, time);
    }

    /**
     * 获取所有一级类目
     * @return
     */
    @Override
    public List<String> getAllMainTitle() {
        return countryMapper.getAllMainTitle();
    }

    /**
     * 获取国家一级类目各个月份销售额
     * @param countryName
     * @param time
     * @param mainTitle
     * @return
     */
    @Override
    public List<MainTitleScale> getMainTitleTurnVolume(String countryName, List<String> time, String mainTitle) {
        return countryMapper.getMainTitleTurnVolume(countryName, time, mainTitle);
    }

    /**
     * 获取物流分析
     * @param time
     * @param countryName
     * @return
     */
    @Override
    public List<LogisticsOrder> getLogistics(String time, String countryName) {
        return countryMapper.getLogistics(time, countryName);
    }

    /**
     * 获取国家月份中top5的公司名称
     * @param time
     * @param countryName
     * @return
     */
    @Override
    public List<String> getLogisticsNameByCount(String time, String countryName) {
        return countryMapper.getLogisticsNameByCount(time, countryName);
    }

    /**
     * 获取top5分布
     * @param times
     * @param countryName
     * @param logisticsName
     * @return
     */
    @Override
    public List<Integer> getLogisticsLimit(List<String> times, String countryName, String logisticsName) {
        return countryMapper.getLogisticsLimit(times, countryName, logisticsName);
    }

    /**
     * 获取前十店铺信息
     * @param time
     * @param countryName
     * @return
     */
    @Override
    public List<ShopTopTen> getShopTen(String time, String countryName) {
        return countryMapper.getShopTen(time, countryName);
    }

    /**
     * 获取前十商品信息
     * @param time
     * @param countryName
     * @return
     */
    @Override
    public List<GoodsTopTen> getGoodsTen(String time, String countryName) {
        return countryMapper.getGoodsTen(time, countryName);
    }


    /**
     * 获取某个月份国家top1店铺信息
     * @param time
     * @param countryName
     * @return
     */
    @Override
    public List<CountryTopOneShop> getTopOneShopCase(String time, String countryName) {
        return countryMapper.getTopOneShopCase(time,countryName);
    }

    /**
     * 获取某个月份某个国家第一店铺名字
     *
     * @param time
     * @param countryName
     * @return
     */
    @Override
    public String getTopOneShop(String time, String countryName) {
        return countryMapper.getTopOneShop(time,countryName);
    }

    /**
     * 获取第一店铺宝贝
     *
     * @param shopName
     * @return
     */
    @Override
    public List<CountryToponeShopMsg> getShops(String shopName) {
        return countryMapper.getShops(shopName);
    }
}
